package com.nuc.bigdata.orm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuc.bigdata.orm.entity.ShopCarGoods;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedList;

/**
 * @author JackLuo
 * @date 2019/12/5
 */
public interface ShopCarGoodsMapper extends BaseMapper<ShopCarGoods> {

    /**
     * 根绝购物车唯一标识列出所有购物车中的商品信息
     * @param shopCarId 购物车唯一标识
     * @return 购物车中商品实体对象的LinkedList
     */
    LinkedList<ShopCarGoods> listByCarId(@Param("shopCarId")String shopCarId);

    /**
     * 查出购物车中是否有商品
     * @param shopCarId 购物车唯一标识
     * @param commodityId 商品唯一标识
     * @return 购物车中商品信息
     */
    ShopCarGoods selectByCarIdAndGoodsId(@Param("shopCarId")String shopCarId,
                                         @Param("commodityId")String commodityId);
}
